// @ts-ignore
/* eslint-disable */

import { request, type RequestOptions } from '@/utils/request';
import type { Signature } from "typescript";
/**
 * 获取用户token
 * @param input 用户登录信息
 * @returns
 */
export async function token(input: UserInut, options?: RequestOptions) {
    return request<string>(`user/token`, {
        method: 'POST',
        data: input,
        ...(options || {}),
    });
}
/**
 * 获取用户列表
 * @param input 用户搜索参数
 * @returns
 */
export async function users(input: UserSearch, options?: RequestOptions) {
    debugger
    return request<UserSearchOut>(`user/users`, {
        method: 'POST',
        data: input,
        ...(options || {}),
    });
}
/**
 * 保存用户签名
 * @param input 签名信息
 * @returns
 */
export async function savesignature(input: any, options?: RequestOptions) {
    return request<UserSearchOut>(`user/save-signature`, {
        method: 'POST',
        data: input,
        ...(options || {}),
    });
}

/**
 * 删除用户签名
 * @returns
 */
export async function removeSignature(options?: RequestOptions) {
    return request<string>(`user/signature`, {
        method: 'DELETE',
        ...(options || {}),
    });
}

/**
 * 物理删除用户
 * @param id 用户ID
 * @returns
 */
export async function realDelete(id: string, options?: RequestOptions) {
    return request<string>(`user/${id}/real-delete`, {
        method: 'POST',
        ...(options || {}),
    });
}
/**
 * 获取用户详情
 * @param id 用户ID
 * @returns
 */
export async function get(id: string, options?: RequestOptions) {
    return request<UserOut>(`user/${id}`, {
        method: 'GET',
        ...(options || {}),
    });
}
/**
 * 编辑用户
 * @param input 用户信息
 * @returns
 */
export async function edit(input: UserOut, options?: RequestOptions) {
    return request<string>(`user/edit`, {
        method: 'POST',
        data: input,
        ...(options || {}),
    });
}
/**
 * 获取用户角色
 * @param id 用户ID
 * @returns
 */
export async function roles(id: string, options?: RequestOptions) {
    return request<UserRoleOut>(`user/${id}/roles`, {
        method: 'GET',
        ...(options || {}),
    });
}
/**
 * 设置用户角色
 * @param input 用户角色列表
 * @returns
 */
export async function postRoles(input: Array<UserRoleOut>, options?: RequestOptions) {
    return request<string>(`user/roles`, {
        method: 'POST',
        data: input,
        ...(options || {}),
    });
}
/**
 * 获取用户菜单
 * @returns
 */
export async function menus(options?: RequestOptions) {
    return request<RoleMenuOut>(`user/menus`, {
        method: 'POST',
        ...(options || {}),
    });
}
/**
 * 重置用户密码
 * @param id 用户ID
 * @returns
 */
export async function resetPwd(id: string, options?: RequestOptions) {
    return request<string>(`user/${id}/reset-pwd`, {
        method: 'GET',
        ...(options || {}),
    });
}
/**
 * 获取当前用户信息
 * @returns
 */
export async function current(options?: RequestOptions) {
    return request<UserOut>(`user/current`, {
        method: 'GET',
        ...(options || {}),
    });
}
/**
 * 批量删除用户
 * @param input 用户ID列表
 * @returns
 */
export async function myDelete(input: Array<string>, options?: RequestOptions) {
    return request<string>(`user/delete`, {
        method: 'POST',
        data: input,
        ...(options || {}),
    });
}
/**
 * 保存用户基础信息（仅基础信息字段）
 * @param input 基础信息
 * @returns
 */
export async function saveBasicInfo(input: any, options?: RequestOptions) {
    return request<string>(`user/save-basic-info`, {
        method: 'POST',
        data: input,
        ...(options || {}),
    });
}
